package com.naiterui.ehp.bs.patient.utils.constants;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.naiterui.ehp.bp.constants.CommonConstant;
import com.naiterui.ehp.bp.domain.ConsultBill;
import com.naiterui.ehp.bp.domain.ConsultSession;
import com.naiterui.ehp.bp.domain.PatientAccountHistory;

/**
 * 患者端常量
 *
 * @version 2015年6月22日 下午10:49:37 by Amber
 */
public class PatientConstant extends CommonConstant {

    // ------------------------ 患者医生关系 -------------------------//

    /**
     * 无关系
     */
    public static final int RELATIONN_TYPE_NULL = -1;

    /**
     * 绑定私人医生
     */
    public static final int RELATIONN_TYPE_PERSONAL = 0;

    /**
     * 关注
     */
    public static final int RELATIONN_TYPE_ATTEND = 1;


    // -----------------------短信类型----------------------//

    /**
     * <验证码单日上限：10条>
     */
    public static final int SMS_DAY_MAX = 10;

    /**
     * <验证码频率，60秒>
     */
    public static final int SMS_FREQUENCY = 60;

    // ------------------------医生出诊时间-------------------------//
    public static final int WEEK_1 = 1;
    public static final int WEEK_2 = 2;
    public static final int WEEK_3 = 3;
    public static final int WEEK_4 = 4;
    public static final int WEEK_5 = 5;
    public static final int WEEK_6 = 6;
    public static final int WEEK_7 = 7;
    public static final Map<Integer, String> WEEKS = Collections.unmodifiableMap(new HashMap<Integer, String>() {
        {
            this.put(WEEK_1, "周一");
            this.put(WEEK_2, "周二");
            this.put(WEEK_3, "周三");
            this.put(WEEK_4, "周四");
            this.put(WEEK_5, "周五");
            this.put(WEEK_6, "周六");
            this.put(WEEK_7, "周日");
        }
    });

    public static final String AM = "上午";
    public static final String PM = "下午";
    public static final String NIGHT = "晚上";

    // -------------------------私人医生绑定通知地址------------------------------//
    public static final String NEW_PERSONAL_NOTICE = "new.personal.notice";

    // ----------------------------积分----------------------------//
    public static final int DOCTOR_POINT_TYPE_PRAISE = 5;
    public static final int DOCTOR_POINT_TYPE_NEW_PERSONAL = 7;

    public static final Map<Integer, String> POINT_NAMES = new HashMap<>();

    static {
        POINT_NAMES.put(DOCTOR_POINT_TYPE_PRAISE, "好评积分");
        POINT_NAMES.put(DOCTOR_POINT_TYPE_NEW_PERSONAL, "邀请患者");
    }

    // ----------------------------格式化异常-------------------------------//
    public static final String HAVE_BINDED_DOCTOR = "您已经扫描过%s医生了，请在问医生找到我立即咨询。";

    // -----------------------------消息类型-------------------------------//
    /**
     * 文本
     */
    public static final int MESSAGE_TYPE_TEXT = 1;
    /**
     * 链接
     */
    public static final int MESSAGE_TYPE_HYPERLINK = 32;

    // --------------------------- 积分 ---------------------------- //
    /**
     * 兑换比例 10积分1元
     */
    public static final int POINT_EXCHANE_UNIT = 10;

    // ----------------------- 病历档案相关 -----------------------//
    /**
     * 病例档案列表页默认图片数量
     */
    public static final int CASE_LIST_IMG_SIZE = 4;

    /**
     * 医嘱图片：<code>CASE_IMG_TYPE_ADVICE</code>
     */
    public static final int CASE_IMG_TYPE_ADVICE = 0;
    /**
     * 处方单图片：<code>CASE_IMG_TYPE_PRESCRIPTION</code>
     */
    public static final int CASE_IMG_TYPE_PRESCRIPTION = 1;
    /**
     * 检验单图片：<code>CASE_IMG_TYPE_CHECK</code>
     */
    public static final int CASE_IMG_TYPE_CHECK = 2;

    // ----------------------- 取消关注状态 ------------------------ //
    /**
     * 取消关注状态：未知：<code>CANCEL_STATUS_UNKONWN</code>
     */
    public static final int CANCEL_STATUS_UNKONWN = 0;
    /**
     * 取消关注状态：未取消：<code>CANCEL_STATUS_NO</code>
     */
    public static final int CANCEL_STATUS_NO = 1;
    /**
     * 取消关注状态：已取消：<code>CANCEL_STATUS_YES</code>
     */
    public static final int CANCEL_STATUS_YES = 2;

    // ---------------------- 注册来源 ----------------------------------//
    /**
     * 患者注册来源：未知：<code>REGIST_SOURCE_UNKONWN</code>
     */
    public static final int REGIST_SOURCE_UNKONWN = 0;
    /**
     * 患者注册来源：自主注册<code>REGIST_SOURCE_SELF</code>
     */
    public static final int REGIST_SOURCE_SELF = 1;
    /**
     * 患者注册来源：推荐注册<code>REGIST_SOURCE_RECOM</code>
     */
    public static final int REGIST_SOURCE_RECOM = 2;
    /**
     * 患者注册来源：DM引流<code>REGIST_SOURCE_DM</code>
     */
    public static final int REGIST_SOURCE_DM = 3;

    // --------------------- 默认赠送诊金金额 ----------------------------//
    // 诊金单位
    public static final int ACCOUNT_UNIT = 100;
    // 手机号诊金 单位：分
    public static final int GIFT_COMPLETE_PERSONAL = 2000;
    // 病历档案诊金 单位：分
    public static final int GIFT_COMPLETE_CASEFILE = 2000;
    // 百分比
    public static final int PLACE_ORDER_GIFT = 10;
    /**
     * 评价星级别描述：<code>STARS_DESC</code>
     */
    public static final List<String> STARS_DESC = Collections
            .unmodifiableList(Arrays.asList("完全没有帮助", "感觉不专业帮助不大", "回复不够及时，意见有帮助", "回复速度能接受，意见专业能够解决问题", "回复及时意见专业很有帮助"));


    public static final Map<Integer, String> INCOME_PT_DESC_MAP = Collections.unmodifiableMap(new HashMap<Integer, String>() {
        {
            this.put(PatientAccountHistory.INCOME_CAUSE_RECHARGE, "充值");
            this.put(PatientAccountHistory.INCOME_CAUSE_REGIST, "注册奖励");
            this.put(PatientAccountHistory.INCOME_CAUSE_BIND_PHONE, "首次验证手机号码");
            this.put(PatientAccountHistory.INCOME_CAUSE_CASE_FILE, "首次上传病例档案");
            this.put(PatientAccountHistory.INCOME_CAUSE_ORDER, "订单完成奖励");
            this.put(PatientAccountHistory.INCOME_CAUSE_PAY, "支付%s医生的咨询诊金时返现");
        }
    });

    /**
     * 问诊记录状态：<code>CONSULT_STATUS_MAP</code>
     */
    public static final Map<Integer, String> CONSULT_STATUS_MAP = Collections.unmodifiableMap(new HashMap<Integer, String>() {
        {
            this.put(ConsultBill.PAY_STATUS_NO_PAID, "未支付");
            this.put(ConsultBill.PAY_STATUS_PAID, "已完成");
        }
    });

    /**
     * 问诊评价状态：<code>CONSULT_COMMENT_STATUS_MAP</code>
     */
    public static final Map<Integer, String> CONSULT_COMMENT_STATUS_MAP = Collections.unmodifiableMap(new HashMap<Integer, String>() {
        {
            this.put(ConsultSession.HAVE_COMMENT, "已完成评价");
            this.put(ConsultSession.HAVE_NOT_COMMENT, "未评价");
        }
    });
    /**
     * 回调返回
     */
    public static final String SUCCESS = "SUCCESS";

    public static final String REWARD_IMG_DOMAIN = "reward.img.domain";

    // TASK任务地址
    public static final String TASK_SCHEDULE_HOST = "schedule.host.url";

    // ---------------------- 患者绑定医生二维码来源 ----------------------------------//
    /**
     * 患者注册来源：未知：<code>REGIST_SOURCE_UNKONWN</code>
     */
    public static final int PERSONAL_SOURCE_WEIXIN = 0;
    /**
     * 患者注册来源：自主注册<code>REGIST_SOURCE_SELF</code>
     */
    public static final int PERSONAL_SOURCE_PC = 1;
    /**
     * RedisKey - 记录处方需求清单 患者选中的医生
     **/
    public static final String REDIS_KEY_PATIENT_DRUG_CHECKED_DOCTOR_ID = CommonConstant.REDIS_PRE_PT + "pt_checked_doctor";

    /**
     * 私人医生关系标识
     */
    public static final int PERSONAL_DOCTOR_RELATION_FLAG_NORMAL = 0; // 正常
    public static final int PERSONAL_DOCTOR_RELATION_FLAG_DELETE = 1; // 已删除

    /**
     * 初始化个人信息类型
     */
    public static final int FAMILY_INIT_TYPE_CONSULTROOM = 1;    // 咨询活动找医生

}
